load("@rules_zig//zig:defs.bzl", "zig_binary", "zig_library", "zig_test")
load("@zml//bazel:zig_srcs.bzl", "zig_srcs")

zig_library(
    name = "tokenizer",
    srcs = ["homemade.zig"],
    import_name = "zml/tokenizer",
    main = "tokenizer.zig",
    visibility = ["//visibility:public"],
    deps = [
        "//ffi:zig",
        "//stdx",
        "//zml/tokenizer/hftokenizers",
        "//zml/tokenizer/sentencepiece",
    ],
)

zig_binary(
    name = "main",
    main = "main.zig",
    visibility = ["//visibility:public"],
    deps = [
        ":tokenizer",
        "//async",
        "//stdx",
    ],
)

zig_test(
    name = "test",
    main = "homemade.zig",
    visibility = ["//visibility:public"],
    deps = [
        "//async",
        "//ffi:zig",
        "//stdx",
    ],
)

zig_srcs(
    name = "sources",
    zig_lib = ":tokenizer",
)
